<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 200px;
        height: 200px;
        background-color: skyblue;
        border: 10px solid red;
        padding: 10px;
      }
    </style>
  </head>
  <body>
    <div></div>
    <script>
      //client与offset的区别是client不包含边框 返回数值不带单位
      var div = document.querySelector("div");
      console.log(div.clientWidth);
      console.log(div.clientTop);
    </script>
  </body>
</html>
